﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeEllipArc3d : OdGeCurve3d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeEllipArc3d(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeEllipArc3d_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeEllipArc3d obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeEllipArc3d()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeEllipArc3d(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeEllipArc3d() : this(GlobalsPINVOKE.new_OdGeEllipArc3d__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeEllipArc3d(OdGeEllipArc3d ell) : this(GlobalsPINVOKE.new_OdGeEllipArc3d__SWIG_1(OdGeEllipArc3d.getCPtr(ell)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeEllipArc3d(OdGeCircArc3d source) : this(GlobalsPINVOKE.new_OdGeEllipArc3d__SWIG_2(OdGeCircArc3d.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeEllipArc3d(OdGePoint3d center, OdGeVector3d majorAxis, OdGeVector3d minorAxis, double majorRadius, double minorRadius) : this(GlobalsPINVOKE.new_OdGeEllipArc3d__SWIG_3(OdGePoint3d.getCPtr(center), OdGeVector3d.getCPtr(majorAxis), OdGeVector3d.getCPtr(minorAxis), majorRadius, minorRadius), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeEllipArc3d(OdGePoint3d center, OdGeVector3d majorAxis, OdGeVector3d minorAxis, double majorRadius, double minorRadius, double startAng, double endAng) : this(GlobalsPINVOKE.new_OdGeEllipArc3d__SWIG_4(OdGePoint3d.getCPtr(center), OdGeVector3d.getCPtr(majorAxis), OdGeVector3d.getCPtr(minorAxis), majorRadius, minorRadius, startAng, endAng), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGePoint3d closestPointToPlane(OdGePlanarEnt plane, OdGePoint3d pointOnPlane, OdGeTol tol)
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeEllipArc3d_closestPointToPlane__SWIG_0(this.swigCPtr, OdGePlanarEnt.getCPtr(plane), OdGePoint3d.getCPtr(pointOnPlane), OdGeTol.getCPtr(tol)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d closestPointToPlane(OdGePlanarEnt plane, OdGePoint3d pointOnPlane)
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeEllipArc3d_closestPointToPlane__SWIG_1(this.swigCPtr, OdGePlanarEnt.getCPtr(plane), OdGePoint3d.getCPtr(pointOnPlane)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGeLinearEnt3d line, out int numInt, OdGePoint3d p1, OdGePoint3d p2, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc3d_intersectWith__SWIG_0(this.swigCPtr, OdGeLinearEnt3d.getCPtr(line), out numInt, OdGePoint3d.getCPtr(p1), OdGePoint3d.getCPtr(p2), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGeLinearEnt3d line, out int numInt, OdGePoint3d p1, OdGePoint3d p2)
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc3d_intersectWith__SWIG_1(this.swigCPtr, OdGeLinearEnt3d.getCPtr(line), out numInt, OdGePoint3d.getCPtr(p1), OdGePoint3d.getCPtr(p2));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGePlanarEnt plane, out int numInt, OdGePoint3d p1, OdGePoint3d p2, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc3d_intersectWith__SWIG_2(this.swigCPtr, OdGePlanarEnt.getCPtr(plane), out numInt, OdGePoint3d.getCPtr(p1), OdGePoint3d.getCPtr(p2), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool intersectWith(OdGePlanarEnt plane, out int numInt, OdGePoint3d p1, OdGePoint3d p2)
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc3d_intersectWith__SWIG_3(this.swigCPtr, OdGePlanarEnt.getCPtr(plane), out numInt, OdGePoint3d.getCPtr(p1), OdGePoint3d.getCPtr(p2));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool projIntersectWith(OdGeLinearEnt3d line, OdGeVector3d projDir, out int numInt, OdGePoint3d pntOnEllipse1, OdGePoint3d pntOnEllipse2, OdGePoint3d pntOnLine1, OdGePoint3d pntOnLine2, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc3d_projIntersectWith__SWIG_0(this.swigCPtr, OdGeLinearEnt3d.getCPtr(line), OdGeVector3d.getCPtr(projDir), out numInt, OdGePoint3d.getCPtr(pntOnEllipse1), OdGePoint3d.getCPtr(pntOnEllipse2), OdGePoint3d.getCPtr(pntOnLine1), OdGePoint3d.getCPtr(pntOnLine2), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool projIntersectWith(OdGeLinearEnt3d line, OdGeVector3d projDir, out int numInt, OdGePoint3d pntOnEllipse1, OdGePoint3d pntOnEllipse2, OdGePoint3d pntOnLine1, OdGePoint3d pntOnLine2)
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc3d_projIntersectWith__SWIG_1(this.swigCPtr, OdGeLinearEnt3d.getCPtr(line), OdGeVector3d.getCPtr(projDir), out numInt, OdGePoint3d.getCPtr(pntOnEllipse1), OdGePoint3d.getCPtr(pntOnEllipse2), OdGePoint3d.getCPtr(pntOnLine1), OdGePoint3d.getCPtr(pntOnLine2));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getPlane(OdGePlane plane)
		{
			GlobalsPINVOKE.OdGeEllipArc3d_getPlane(this.swigCPtr, OdGePlane.getCPtr(plane));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isCircular(OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc3d_isCircular__SWIG_0(this.swigCPtr, OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isCircular()
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc3d_isCircular__SWIG_1(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isInside(OdGePoint3d point, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc3d_isInside__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(point), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isInside(OdGePoint3d point)
		{
			bool result = GlobalsPINVOKE.OdGeEllipArc3d_isInside__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(point));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d center()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeEllipArc3d_center(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double minorRadius()
		{
			double result = GlobalsPINVOKE.OdGeEllipArc3d_minorRadius(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double majorRadius()
		{
			double result = GlobalsPINVOKE.OdGeEllipArc3d_majorRadius(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector3d minorAxis()
		{
			OdGeVector3d result = new OdGeVector3d(GlobalsPINVOKE.OdGeEllipArc3d_minorAxis(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector3d majorAxis()
		{
			OdGeVector3d result = new OdGeVector3d(GlobalsPINVOKE.OdGeEllipArc3d_majorAxis(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector3d normal()
		{
			OdGeVector3d result = new OdGeVector3d(GlobalsPINVOKE.OdGeEllipArc3d_normal(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double startAng()
		{
			double result = GlobalsPINVOKE.OdGeEllipArc3d_startAng(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double endAng()
		{
			double result = GlobalsPINVOKE.OdGeEllipArc3d_endAng(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d startPoint()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeEllipArc3d_startPoint(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d endPoint()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeEllipArc3d_endPoint(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc3d setCenter(OdGePoint3d center)
		{
			OdGeEllipArc3d result = new OdGeEllipArc3d(GlobalsPINVOKE.OdGeEllipArc3d_setCenter(this.swigCPtr, OdGePoint3d.getCPtr(center)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc3d setMinorRadius(double rad)
		{
			OdGeEllipArc3d result = new OdGeEllipArc3d(GlobalsPINVOKE.OdGeEllipArc3d_setMinorRadius(this.swigCPtr, rad), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc3d setMajorRadius(double rad)
		{
			OdGeEllipArc3d result = new OdGeEllipArc3d(GlobalsPINVOKE.OdGeEllipArc3d_setMajorRadius(this.swigCPtr, rad), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc3d setAxes(OdGeVector3d majorAxis, OdGeVector3d minorAxis)
		{
			OdGeEllipArc3d result = new OdGeEllipArc3d(GlobalsPINVOKE.OdGeEllipArc3d_setAxes(this.swigCPtr, OdGeVector3d.getCPtr(majorAxis), OdGeVector3d.getCPtr(minorAxis)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc3d setAngles(double startAng, double endAng)
		{
			OdGeEllipArc3d result = new OdGeEllipArc3d(GlobalsPINVOKE.OdGeEllipArc3d_setAngles(this.swigCPtr, startAng, endAng), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc3d set(OdGePoint3d center, OdGeVector3d majorAxis, OdGeVector3d minorAxis, double majorRadius, double minorRadius)
		{
			OdGeEllipArc3d result = new OdGeEllipArc3d(GlobalsPINVOKE.OdGeEllipArc3d_set__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(center), OdGeVector3d.getCPtr(majorAxis), OdGeVector3d.getCPtr(minorAxis), majorRadius, minorRadius), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc3d set(OdGePoint3d center, OdGeVector3d majorAxis, OdGeVector3d minorAxis, double majorRadius, double minorRadius, double startAng, double endAng)
		{
			OdGeEllipArc3d result = new OdGeEllipArc3d(GlobalsPINVOKE.OdGeEllipArc3d_set__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(center), OdGeVector3d.getCPtr(majorAxis), OdGeVector3d.getCPtr(minorAxis), majorRadius, minorRadius, startAng, endAng), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc3d set(OdGeCircArc3d arc)
		{
			OdGeEllipArc3d result = new OdGeEllipArc3d(GlobalsPINVOKE.OdGeEllipArc3d_set__SWIG_2(this.swigCPtr, OdGeCircArc3d.getCPtr(arc)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeEllipArc3d Assign(OdGeEllipArc3d ell)
		{
			OdGeEllipArc3d result = new OdGeEllipArc3d(GlobalsPINVOKE.OdGeEllipArc3d_Assign(this.swigCPtr, OdGeEllipArc3d.getCPtr(ell)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void orthogonolizeAxes(OdGeTol tol, out OdGe.ErrorCondition flag)
		{
			GlobalsPINVOKE.OdGeEllipArc3d_orthogonolizeAxes__SWIG_0(this.swigCPtr, OdGeTol.getCPtr(tol), out flag);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void orthogonolizeAxes(OdGeTol tol)
		{
			GlobalsPINVOKE.OdGeEllipArc3d_orthogonolizeAxes__SWIG_1(this.swigCPtr, OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void orthogonolizeAxes()
		{
			GlobalsPINVOKE.OdGeEllipArc3d_orthogonolizeAxes__SWIG_2(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeVector3d tangentAt(double param)
		{
			OdGeVector3d result = new OdGeVector3d(GlobalsPINVOKE.OdGeEllipArc3d_tangentAt(this.swigCPtr, param), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getGeomExtents(OdGeExtents3d extents)
		{
			GlobalsPINVOKE.OdGeEllipArc3d_getGeomExtents(this.swigCPtr, OdGeExtents3d.getCPtr(extents));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdResult inverseTangent(OdGeVector3d tan, OdGeDoubleArray arg1)
		{
			OdResult result = (OdResult)GlobalsPINVOKE.OdGeEllipArc3d_inverseTangent(this.swigCPtr, OdGeVector3d.getCPtr(tan), OdGeDoubleArray.getCPtr(arg1));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult inverseTangentPlane(OdGePlane refPlane, OdGeDoubleArray arg1)
		{
			OdResult result = (OdResult)GlobalsPINVOKE.OdGeEllipArc3d_inverseTangentPlane(this.swigCPtr, OdGePlane.getCPtr(refPlane), OdGeDoubleArray.getCPtr(arg1));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
